]> dgit.raspbian.org Git - gnome-shell.git/commit
st-theme-node-drawing: Don't create lots of one-shot materials
authorNeil Roberts <neil@linux.intel.com>
Wed, 27 Oct 2010 16:41:20 +0000 (17:41 +0100)
committerNeil Roberts <neil@linux.intel.com>
Thu, 28 Oct 2010 19:02:41 +0000 (20:02 +0100)
commitd66e7dd49edc589577477a98c2806b7930335e24
tree709b3bbab77f90607c600f62bd8d7ab525dcba95
parentf365484a5c97df96ce92d23c672bd0ed1622be58
st-theme-node-drawing: Don't create lots of one-shot materials

A few places in st-theme-node-drawing create one-shot material, paint
with it and then free it. This is suboptimal with current Cogl because
it will end up compiling an ARBfp program just for that single paint
and then it will throw it away when the material is destroyed.

There is a new function in st-private.c called
_st_create_texture_material. This creates a simple material for a
texture based on a common parent material that points to a dummy
texture. Any materials created with this function are likely to be
able to share the same program unless the material is further modified
to contain a different number of layers. It would be possible to use
cogl_set_source_texture for this instead except that it's not possible
to modify the material's color in that case so we couldn't render the
texture with opacity.

The corner textures are now stored as a handle to a material that
references the texture rather than storing the texure directly. There
is also a separate border_material member which always points to
border_texture as the only layer.

https://bugzilla.gnome.org/show_bug.cgi?id=633340
src/st/st-private.c
src/st/st-private.h
src/st/st-theme-node-drawing.c
src/st/st-theme-node-private.h